package util;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;

public class ResizeImage {
    public static boolean imageConvertCommon(File tSourceImageFile , File sDestImage, String fileSuffix) {

        try {
            BufferedImage bi = ImageIO.read(tSourceImageFile);

            if (bi == null) {
                //图片解码错误
                return false;
            }
            if (!ImageIO.write(bi, fileSuffix,sDestImage)){
                return false;
            }
        } catch (Exception e) {
            return false;
        }
        return true;
    }

}

